//
//  TwentyFiveViewController.m
//  项目二
//
//  Created by rimi on 16/5/17.
//  Copyright © 2016年 objective. All rights reserved.
//

#import "TwentyFiveViewController.h"
#import "Datai20ViewController.h"



@interface TwentyFiveViewController ()
@property (nonatomic,strong)UILabel *namelabel1;
@property (nonatomic,strong)UILabel *agelabel;
@end

@implementation TwentyFiveViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor purpleColor];
    self.title = @"block传值_Test";
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    btn.frame = CGRectMake(300, 300, 100, 100);
    btn.backgroundColor = [UIColor redColor];
    [btn setTitle:@"ok" forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(btnTaped:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
    
    _agelabel = [[UILabel alloc]initWithFrame:CGRectMake(200, 200, 200, 50)];
    _agelabel.text = @"name";
    _agelabel.backgroundColor = [UIColor cyanColor];
    [self.view addSubview:_agelabel];
    
    _namelabel1 = [[UILabel alloc]initWithFrame:CRM(100, 100, 200, 50)];
    _namelabel1.text = @"age";
    _namelabel1.backgroundColor = [UIColor blueColor];
    [self.view addSubview:_namelabel1];
}

-(void)btnTaped:(UIButton *)sender {
    Datai20ViewController *datai20 = [[Datai20ViewController alloc]init];
    
    [datai20 updateHomeData:^(NSArray *arr) {
        _namelabel1.text = arr[0];
        _agelabel.text = arr[1];
    }];
    [self.navigationController pushViewController:datai20 animated:YES];
    
    
    
}


@end
